<template>
  <button @click="sum++">增加数值 {{ sum }} </button>
</template>

<script setup lang="ts">


import { watch, ref } from 'vue'
const sum = ref(1);
// New: 新值 | Old: 老值
watch(sum, (New, Old) => {
  console.log(`新值:${New} ——— 老值:${Old}`)
}
)


</script>
